package com.androidbook.droid1;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;


public class DroidActivity extends Activity {
	int tel = 0;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.main);
                
        Button buttonrood = (Button)findViewById(R.id.buttonrood);
        Button buttonblauw = (Button)findViewById(R.id.buttonblauw);
        Button buttongroen = (Button)findViewById(R.id.buttongroen);
        
        buttonrood.setOnClickListener(Rood);
        buttongroen.setOnClickListener(Groen);
        buttonblauw.setOnClickListener(Blauw);
        
        
        
        }

    
    private OnClickListener Rood = new OnClickListener() {
        

		public void onClick(View v) {
			
			LinearLayout linear = (LinearLayout)findViewById(R.id.linearlayout);
			linear.setBackgroundColor(Color.RED);
			
			
		}
    };
    
    private OnClickListener Blauw = new OnClickListener() {
        

		public void onClick(View v) {
			
			LinearLayout linear = (LinearLayout)findViewById(R.id.linearlayout);
			linear.setBackgroundColor(Color.BLUE);
			
			
		}
    };
    
    private OnClickListener Groen = new OnClickListener() {
        

		public void onClick(View v) {
			
			LinearLayout linear = (LinearLayout)findViewById(R.id.linearlayout);
			linear.setBackgroundColor(Color.GREEN);
			
			
		}
    };

}